import request from "@/utils/request";
export function UserLogin(data) {
    return request({
        url: "/api/v1/user/login",
        method: "post",
        data,
    });
}
// 获取公钥
export function GetPublicKey() {
    return request({
        url: "/api/v1/key/public",
        method: "get",
    });
}
// 刷新RefreshToken
export function Refresh(refreshToken) {
    return request({
        headers: {
            Authorization: refreshToken,
        },
        url: "/api/v1/token/refresh",
        method: "post",
    });
}
// 删除accessToken
export function LogoutAccessToken() {
    return request({
        url: "/api/v1/user/logout/access",
        method: "post",
    });
}
// 删除RefreshToken
export function LogoutRefreshToken(refreshToken) {
    console.log(refreshToken);
    return request({
        headers: {
            Authorization: refreshToken
        },
        url: "/api/v1/user/logout/refresh",
        method: "post",
    });
}
// 获取用户列表
export function getUserList(limit, page) {
    return request({
        url: `/api/v1/user/getUserList/${limit}/${page}`,
        method: "get",
    });
}
// 模糊搜索用户
export function SearchUsers(fuzzyName, limit, page) {
    return request({
        url: `/api/v1/user/query/fuzzy/${fuzzyName}/${limit}/${page}`,
        method: "get",
    });
}
// 编辑用户
export function EditUser(data) {
    return request({
        url: "/api/v1/root/user/alter",
        method: "put",
        data
    });
}
// 删除用户
export function DeleteUser(id) {
    return request({
        url: `/api/v1/user/deleteById/${id}`,
        method: "delete",
    });
}
// 为用户绑定角色
export function bindRole(data) {
    return request({
        url: "/api/v1/user/bindRole",
        method: "post",
        data
    });
}
// 获取用户的角色
export function getRoleListById(id) {
    return request({
        url: `/api/v1/user/getRoleList/${id}`,
        method: "get",
    });
}
// 用户审核
export function UserReview(data) {
    return request({
        url: "/api/v1/user/review",
        method: "post",
        data
    });
}
// 通过token获取用户信息
export function getUserInfo() {
    return request({
        url: `/api/v1/user/current`,
        method: "get",
    });
}
// 批量删除用户
export function BatchDeleteUser(data) {
    return request({
        url: `/api/v1/root/user/batch/deleteUser`,
        method: "delete",
        data
    });
}
// 获取已删除列表
export function getUserDeleteList(limit, page) {
    return request({
        url: `/api/v1/root/user/deleteList/${limit}/${page}`,
        method: "get",
    });
}